<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Document</title>
</head>
<body>
    <p><input type="text" id="u" ></p>
    <p><input type="text" id="p"></p>
    <p><input type="button" value="提交" id='btn'></p>

    <script type="text/javascript">
        var btn = document.getElementById('btn');
        btn.onclick=function() {
            var u = document.getElementById('u').value;
            var p = document.getElementById('p').value;
            var params = {'user_id': u, 'password': p};
            var xhr = new XMLHttpRequest();
            xhr.open('POST','http://101.42.117.143:9100/login', true);
            xhr.send(JSON.stringify(params));
            
            xhr.onload=function(){
                console.log(JSON.parse(xhr.responseText))
            }

        }
    </script>
</body>
</html>